﻿@model TO3.Models.Match

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Match</h4>
        <hr />
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.TournamentId)
        @Html.HiddenFor(model => model.Player1Id)
        @Html.HiddenFor(model => model.Player2Id)

        <div class="form-group">
            @Html.LabelFor(model => model.TournamentId, new { @class = "control-label col-md-2" })
            <div class="col-md-14">
                @Html.DisplayFor(model => model.Tournament.Name)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Player1Id, new { @class = "control-label col-md-2" })
            <div class="col-md-14">
                @Html.DisplayFor(model => model.Player1.Name)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Player2Id, new { @class = "control-label col-md-2" })
            <div class="col-md-14">
                @Html.DisplayFor(model => model.Player2.Name)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.TableId, new { @class = "control-label col-md-2" })
            <div class="col-md-13">
                @Html.EditorFor(model => model.TableId)
                @Html.ValidationMessageFor(model => model.TableId)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Round, new { @class = "control-label col-md-2" })
            <div class="col-md-13">
                @Html.EditorFor(model => model.Round)
                @Html.ValidationMessageFor(model => model.Round)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Player1CP, new { @class = "control-label col-md-2" })
            <div class="col-md-13">
                @Html.EditorFor(model => model.Player1CP)
                @Html.ValidationMessageFor(model => model.Player1CP)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Player2CP, new { @class = "control-label col-md-2" })
            <div class="col-md-13">
                @Html.EditorFor(model => model.Player2CP)
                @Html.ValidationMessageFor(model => model.Player2CP)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.WinnerId, new { @class = "control-label col-md-2" })
            <div class="col-md-14">
                @Html.DropDownList("WinnerId", String.Empty)
                @Html.ValidationMessageFor(model => model.WinnerId)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
